<%-- 
    Document   : order.jsp
    Created on : 10 mars 2013, 10:38:33
    Author     : alocubiche
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="model.Item"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id="panier" class="model.Panier" scope="session" />
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Commande</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    <body>
        <h1>Votre commande</h1>
        <hr />
        <h2><a href='index.jsp'>Accueil</a></h2>
        <form method="post" action="MainController">
            <table border="1" width="60%" align="center">
                <tr>
                    <th>Name</th>
                    <th colspan="1">Quantity</th>
                    <th colspan="1">Price</th>
                    <th colspan="1">Selectionner</th>
                </tr>
                <% for(Item item : panier.getArticles()){ %>
                <tr>
                        <td><i><%=item.getName()%></i></td>
                        <td><i><%=item.getQuantity()%></i></td>
                        <td><i><%=item.getPrice()%></i></td>
                        <td>
                            <input type="checkbox" name="id" value="<%=item.getId()%>" />
                            <input type="hidden" name="idQuantity" value="<%=item.getQuantity()%>" />
                        </td>
                        
                        
                </tr>        
                <% } %>
                <tr>
                    <td style="height:37px;" colspan='4'><a href="./index.jsp" onclick="document.forms[0].submit();return false;"><input class="siteButton" type="button" name="action" value="Retirer"></a></td>
                </tr>
            </table>
            <table style="margin-top:30px;" border="1" width="60%" align="center">
                
                <tr>
                    <td colspan='2'>Nombre d'articles : <%=panier.numberArticle()%></td>
                    <td colspan='2'>Montant total : <%=panier.totalAmount()%> euros</td>
                </tr>
                
            </table>
            <input type="hidden" name="action" value="Remove" />
            
        </form>
    </body>
</html>
